Release 10.1A: OpenEdge Application Server:
Developing AppServer Applications
Understanding procedure handles in distributed Progress 4GL sessions
Every active Progress 4GL procedure, whether running on a Progress 4GL client or in an AppServer agent, has a procedure handle associated with it. Among the various attributes of the procedure handle, the
PROXY,REMOTE, andPERSISTENTattributes combine to provide important information about the procedure and its handle in a distributed application environment.REMOTE attribute
The
THIS-PROCEDUREsystem handle returns the current procedure handle value from within any executing block of an external procedure. A current procedure handle created within an AppServer session for a remote procedure request is a remote procedure handle. ItsREMOTEattribute is, therefore, set toTRUE. If theREMOTEattribute isFALSE, then the current procedure was created as the result of a local procedure call (that is, a procedure call initiated and executed within the current Progress 4GL session context).PERSISTENT attribute
When you execute a persistent procedure from a local procedure call, as with any procedure, the persistent procedure can reference its own context using the
THIS-PROCEDUREsystem handle. This system handle returns a procedure handle to the persistent procedure’s own context.Also, the procedure that executes the
RUNstatement that creates the persistent procedure can obtain a reference to the same persistent procedure context using theSEToption of theRUNstatement. This option returns the same procedure handle as theTHIS-PROCEDUREsystem handle accessed from within the persistent procedure.Thus, for a local persistent procedure, there is only one handle for a specific persistent procedure context, but there might be many references to it. For any such reference to a persistent procedure handle, the
PERSISTENTattribute returns the valueTRUE.PROXY attribute
When a Progress 4GL client application executes a remote persistent procedure, two persistent procedure handles are created: one within the client application session and another separate handle within the AppServer session where the persistent procedure is created. OpenEdge internally maintains a mapping between the two handles. The handle within the client application is a proxy persistent procedure handle, and its
PROXYattribute and itsPERSISTENTattributes are set toTRUE, but itsREMOTEattribute isFALSE. The handle within the AppServer agent is a remote persistent procedure handle, and itsREMOTEattribute and thePERSISTENTattribute are set toTRUE, but itsPROXYattribute isFALSE.Unlike persistent procedure handles used for local procedures, the proxy persistent procedure handle and the remote persistent procedure handle are truly separate handles. For example, setting the
PRIVATE-DATAattribute on a remote persistent procedure handle has no effect on thePRIVATE-DATAattribute of the corresponding proxy persistent procedure handle.How the attributes work together
Table 4–8 summarizes the settings of the
PROXY,REMOTE, andPERSISTENTprocedure handle attributes for various types of procedure call scenarios.
In Table 4–8, Caller Handle refers to the handle returned by the
RUNstatement. This column is relevant only for persistent procedures because you can only reference the procedure handle of a procedure that you call persistently using theSEToption of theRUNstatement. Callee Handle refers to the procedure handle within the procedure that is being executed. You can reference this handle using theTHIS-PROCEDUREsystem handle, whether or not the current procedure was called persistently.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |